{% extends "bootstrap/base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block styles %}
{{super()}}
<link rel="stylesheet"
      href="{{ url_for('static', filename='custom.css') }}">
<link rel="stylesheet"
      href="https://fonts.googleapis.com/css?family=EB+Garamond|Open+Sans" >
{% endblock %}

{% block title %}{{ details['chronofile_name'] }}{% endblock %}

{% block head %}
{{ super() }}
<link rel="shortcut icon" href="{{ url_for('static', filename = 'favicon.ico') }}"
type="image/x-icon">
<link rel="icon" href="{{ url_for('static', filename = 'favicon.ico') }}"
type="image/x-icon">
{% endblock %}

{% block body %}
<div id="wrapper">

    {% block navbar %}
    <div class="navbar navbar-inverse" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">{{ details['chronofile_name'] }}</a>
            </div>
            <div class="navbar-collapse collapse">
                {% if session.logged_in %}
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="{{ url_for('main.view_all_days') }}">Days</a>
                        <li><a href="{{ url_for('main.view_all_tags') }}">Tags</a></li>
                        <li><a href="{{ url_for('admin.view_admin') }}">Admin</a></li>
                        <li><a href="{{ url_for('auth.logout') }}">Log out</a></li>
                    </ul>
                {% else %}
                    <ul class="nav navbar-nav navbar-right">
                        {% if register %}
                        <li><a href="{{ url_for('auth.register') }}">Register</a></li>
                        {% else %}
                        <li><a href="{{ url_for('auth.login') }}">Log in</a></li>
                        {% endif %}
                    </ul>
                {% endif %}
            </div>
        </div>
    </div>
    {% endblock %}

    {% block content %}
     <div id="content">
        <div class="container container-content">
        {% for message in get_flashed_messages() %}
            <div class="alert alert-info">
            <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
            <span class="message">{{ message }}</span>
            </div>
        {% endfor %}
        </div>
        <div class="container container-content">
            {% block page_content %}{% endblock %}
        </div>
    </div>
    {% endblock %}

    {% block footer %}
    <div id="footer">
        <div class="modal-footer">
            <div class="container container-content">
                <ul class="nav navbar-nav navbar-right navbar-footer">
                    <li>&#169; 2017 {{ details['author_name'] }}</li>
                </ul>
            </div>
        </div>
    {% endblock %}

    {% block scripts%}
    {{super()}}
    {% endblock %}

</div>
{% endblock %}